﻿@page "/achievement"
@namespace SwashbucklerDiary.Rcl.Pages
@inherits ImportantComponentBase

<MyAppBar>
    <MButton Icon="true"
             OnClick="NavigateToBack">
        <MIcon>
            mdi-arrow-left
        </MIcon>
    </MButton>

    <SearchTextField @bind-Visible="showSearch"
                     @bind-Value="search"
                     Title="@(I18n.T("Mine.Achievement.Name"))"
                     OnInput="UpdateAchievements">
    </SearchTextField>

    <MButton Icon="true"
             OnClick="()=>showSearch=!showSearch">
        <MIcon>
            mdi-magnify
        </MIcon>
    </MButton>
</MyAppBar>

<ScrollContainer>
    <div class="adaptive-card-container">
        @foreach (var item in _achievements)
        {
            <AchievementCard @key="item"
                             Value="item">
            </AchievementCard>
        }
    </div>

    <EmptyResult Show="_achievements.Count == 0"></EmptyResult>
</ScrollContainer>
